<include file="Common:header" />
<body>
<!--面包屑导航 开始-->
<div class="crumb_warp">
    <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
    <i class="fa fa-home"></i> <a href="{:U(MODULE_NAME.'/Index/info')}">首页</a> &raquo; 修改网站配置
</div>
<!--面包屑导航 结束-->

<!--结果集标题与导航组件 开始-->
<div class="result_wrap">
    <div class="result_title">
        <h3>快捷操作</h3>
    </div>
    <div class="result_content">
        <div class="short_wrap">
            <a href="{:U(MODULE_NAME.'/Config/add')}"><i class="fa fa-plus"></i>添加网站配置</a>
            <a href="{:U(MODULE_NAME.'/Config/index')}"><i class="fa fa-refresh"></i>全部网站配置</a>
        </div>
    </div>
</div>
<!--结果集标题与导航组件 结束-->

<div class="result_wrap">
    <form action="{:U(MODULE_NAME.'/Config/edit',array('conf_id'=>$conf['conf_id']))}" method="post">
        <table class="add_tab">
            <tbody>
            <tr>
                <th><i class="require">*</i>标题：</th>
                <td>
                    <input type="text" size="20" name="conf_title" id="conf_title" value="{$conf.conf_title}">
                    <span><i class="fa fa-exclamation-circle yellow"></i>配置标题必须填写!</span>
                </td>
            </tr>
            <tr>
                <th><i class="require">*</i>名称：</th>
                <td>
                    <input type="text" size="20" name="conf_name" id="conf_name" value="{$conf.conf_name}">
                    <span><i class="fa fa-exclamation-circle yellow"></i>配置名称必须填写!（字母格式：web_info）</span>
                </td>
            </tr>
            <tr>
                <th>类型：</th>
                <td>
                    <input type="radio" name="conf_field_type" value="input" <if condition="($conf.conf_field_type eq 'input') "> checked </if> onclick="getField()"/>input &nbsp;&nbsp;
                    <input type="radio" name="conf_field_type" value="textarea" <if condition="($conf.conf_field_type eq 'textarea') "> checked </if>  onclick="getField()"/>textarea &nbsp;&nbsp;
                    <input type="radio" name="conf_field_type" value="radio" <if condition="($conf.conf_field_type eq 'radio') "> checked </if>  onclick="getField()"/>radio
                </td>
            </tr>

            <tr id="conf_field_value">
                <th>类型值：</th>
                <td>
                    <input type="text" class="sm" name="conf_field_value" value="{$conf.conf_field_value}" >
                    <span><i class="fa fa-exclamation-circle yellow"></i>类型值只有在radio的情况下才需要配置，格式:1|开启,0|关闭</span>
                </td>
            </tr>
            <tr>
                <th>排序：</th>
                <td>
                    <input type="text" class="sm" name="conf_order" value="{$conf.conf_order}">
                </td>
            </tr>
            <tr>
                <th>说明：</th>
                <td>
                    <textarea name="conf_tips"> {$conf.conf_tips}</textarea>
                </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <input type="submit" id="button" value="提交">
                    <input type="button" class="back" onclick="history.go(-1)" value="返回">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
<script>
    getField();
    function getField(){
        var filed = $('input[name=conf_field_type]:checked').val(); //获取 点击radio 的值
        if(filed == 'radio'){
            $('#conf_field_value').show();
        }else{
            $('#conf_field_value').hide();
        }
    }
    $(function() {
        $("#button").click(function() {
            var conf_title = $("#conf_title").val();
            var conf_name = $("#conf_name").val();
            if(conf_title == 0){
                layer.msg('配置标题必须填写！');
                $("#conf_title").focus();
                return false;
            }
            if(conf_name == ''){
                layer.msg('配置名称必须填写！');
                $("#conf_name").focus();
                return false;
            }
        });
    })
</script>
</body>
</html>